package com.example.administrator.text;

import android.app.Application;
import android.content.Context;
import android.support.multidex.MultiDex;
import android.util.Log;

import com.uzmap.pkg.openapi.APICloud;

import cn.jpush.android.api.JPushInterface;

/**
 * Created liuxiaobin15/11/2
 */
public class MyApplication extends Application {
    private static MyApplication mApp;
    private  Context mContext;

    @Override
    public void onCreate() {
        super.onCreate();
        mApp = this;
        mContext = this;
        //JPushInterface.setDebugMode(true);           //正式版的时候设置false，关闭调试
        //JPushInterface.init(this);
        try {
          APICloud.initialize(this);
        }catch (Exception e){
            Log.e("WiFi","APICloud初始化失败");
        }
    }

    public static MyApplication getApp() {
        return mApp;
    }


    public Context getAppContext() {
        return mContext;
    }

    /**
     * 5.0 以下，单个DEX文件可被引用的方法总数被限制为65536 超过就会报错 NoClassDefFoundError
     * 这个方法是将一个DEX文件分拆成多个DEX文件
     */
    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base); MultiDex.install(this);
    }
}